#include <memory>
#include "client.hpp"

using namespace std;
using namespace nt_client;

void Usage(const char *program)
{
    cout << "Usage:" << endl;
    cout << "\t" << program << " ServerIP ServerPort" << endl;
}

int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        // 错误的启动方式，提示错误信息
        Usage(argv[0]);
        return USAGE_ERR;
    }

    // 服务器IP与端口号
    string ip(argv[1]);
    uint16_t port = stoi(argv[2]);

    unique_ptr<TcpClient> usvr(new TcpClient(ip, port));

    usvr->InitClient();
    usvr->StartClient();
    return 0;
}